<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>在线换证审核</title>
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width,initial-scale=1">
    <meta name="renderer" content="webkit">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <meta name="viewport"
          content="width=device-width, initial-scale=1, maximum-scale=1">
    <meta name="apple-mobile-web-app-status-bar-style" content="black">
    <meta name="apple-mobile-web-app-capable" content="yes">
    <meta name="format-detection" content="telephone=no">
    <link rel="stylesheet" href="../../layui/css/layui.css" media="all"/>
    <link rel="stylesheet" href="../../css/listDetail.css" media="all"/>
    <link rel="stylesheet" href="//at.alicdn.com/t/font_tnyc012u2rlwstt9.css" media="all"/>
    <style>
        .pic p {
            text-align: center;
        }
        .leftMain{
            padding-left: 50px;
            padding-top: 25px;
        }
        .contain .rightMain {
            padding-right: 20px;
            margin-top: 20px;
            border-left: none;
            border-right: 1px dashed #bfbfbf;
        }
        .baseInfor select{
            padding: 5px 0;
        }
        .contain .rightMain .pic{
            height: 600px;
        }
        .contain .btn #btns{
            left: 40%;
        }
        .contain .baseInfor{
            margin-top: 80px;
        }
    </style>
</head>
<body class="childrenBody">
<div class="contain">
    <h3><i class="layui-icon">&#xe63c;</i>会员升级审核信息</h3>
    <div class="layui-row">
        <div class="rightMain layui-col-md5 layui-col-sm5 layui-col-xs6">
            <div class="pic">
                <img id="uplevelpic" src="" class="img-responsive" title="升级申请书" alt="升级申请书">
            </div>
        </div>
        <div class="leftMain layui-col-md7 layui-col-sm7 layui-col-xs6">
            <div class="contain-main">
                <ul class="baseInfor layui-clear">
                    <li id="comp_name"><strong>企业名称：</strong></li>
                    <li id="comp_code"><strong>企业代码：</strong></li>
                    <li id="comp_level"><strong>当前等级：</strong></li>
                    <li><strong>下一等级：</strong>
                        <select id="nextLevel">
                            <option value="-1">请选择</option>
                            <option value="4">会员单位</option>
                            <option value="3">理事单位</option>
                            <option value="2">常务理事会</option>
                            <option value="1">会长与副会长</option>
                        </select>
                    </li>
                    <li id="pro_phone"><strong>联系方式：</strong></li>
                    <li id="pro_email"><strong>电子邮箱：</strong></li>
                    <li id="pro_address"><strong>企业地址：</strong></li>
                </ul>
            </div>
        </div>
        <div class="btn layui-clear">
            <input type="button" id="btns" value="审核通过">
        </div>
    </div>
</div>
<div class="cover"></div>
<div id="alertWindow">
    <div class="img">
        <i></i>
        <img src="../img/timg2.jpg">
    </div>
</div>
</body>
<script type="text/javascript" src="../../layui/layui.js"></script>
<script type="text/javascript">
//引入配置模块
layui.config({
	base : "js/"
}).use(['layer','jquery'],function(){
	var	layer = parent.layer === undefined ? layui.layer : parent.layer,
		$ = layui.jquery;
	//从本地sessionStorage获取上一页面的数据
	var id=getPara().id;
	var data=$.parseJSON(window.sessionStorage.getItem('datalist'+id));
	console.log(data)
	fillData(data);
	//审核提交数据
	$('#btns').click(function(){
		//判断会员等级是否选中
		var nextLevel=$('#nextLevel').val();
		console.log(nextLevel)
		if(nextLevel==-1){
			layer.msg('请选择等级')
			return	
		}
		//提交数据
 		$.get('admincompany_ApproveUpdateLevel',{id:id,nextLevel:nextLevel},function(data,status){
			if(data==1){
				layer.msg('审核通过')
				layer.closeAll('iframe');
				
			}
			if(data==0){
				layer.msg('请稍后再试');
				layer.closeAll('iframe');
				}
		});
	});
	//渲染数据
	function fillData(data){
	$('#uplevelpic').attr('src','/xjeca/upload/companyinfo/'+data.profile.pro_uplevel)
	$('#comp_name').append(data.comp_name);
	$('#comp_code').append(data.comp_code);
	//会员等级显示
	if(data.comp_level==4) $('#comp_level').append('会员单位');
	if(data.comp_level==3) $('#comp_level').append('理事单位');
	if(data.comp_level==2) $('#comp_level').append('常务理事会');
	if(data.comp_level==1) $('#comp_level').append('会长与副会长');
	$('#pro_phone').append(data.profile.pro_phone);
	$('#pro_email').append(data.profile.pro_email);
	$('#pro_address').append(data.profile.pro_address);
	}
    //获取URL的参数
    function getPara(){
    	var url = location.search; //获取url中含"?"符后的字串
    	var theRequest = new Object();
    	if(url.indexOf("?") != -1){
			var str = url.substr(1);
    	    strs = str.split("&");
			for(var i = 0; i < strs.length; i ++) {
    	    	theRequest[strs[i].split("=")[0]]=unescape(strs[i].split("=")[1]);
    	      }
    	   }
		return theRequest;
    }
});
</script>
</html>